Fixed a bug where spawned objects wouldn't get properly cleaned up after reset.