Close #16 Additional tests and various test improvements