Need help in debugging a stack corruption