Cleanups and a few more tests