Several fragmentation-related bugfixes.