Fixing input and state reset issues with threaded builds.
Merge pull request #287 from crazysam/dev

Fixing input and state reset issues with threaded builds.