Some changes to prevent memory leaks from gamePane (not fiished yet).