fixes and additions to unit tests