Game management bugfixes and tests