Off-by-one error in GC