Cleanup, slab bugfixes and some tests