Fixed a stupid access after delete bug