Fix code after last commit, add missing tests
Refs #330