Fix bit manipulation during sweep phase.
Implemented rudimentary gc check.