Fixed issues #10 and #11, and some minor changes

*Fixed issue #10
*Fixed issue #11
*Small typo in comment
*Removed isAwake from being set to true twice in a row