general improvements to usability, fix unit tests