Fixing up error messages and mock.