core: Fixes for garbage collector/jam scraper.