working on tests, minor fixes