Fixed a couple garbage collection errors