Fix memory leak introduced by Mojang