cleaned up tests, improved exception