Fix lots of errors to do with GC rules