unit testing fixes