Fixed yet another memory error in previous commits