Fixed small bug in gc