General GC optimizations, bug fixes