Improvements to game logic. Fixes #6