Fixing input and state reset issues with threaded builds.