Added more tests, some cleanups