The internal error wasn't internal. Updated message and added more sanity checking. Fixed test.