oob_gc: reimplement to fix breakage and add tests