Added some debug code

Added some debug code for check memory leaks in the game.