Fix code for unit tests, refs #275