Fix minor issues with tests and implementation code