Fixed various bugs with game.js