Attempt to fix unhandled exception when executing commands.