refactored some tests
bug fixes, code coverage, slight tweaks