Cleanup and some tests (still failing...)