Improvements - tests, fixes