Change exception so that it's catchable. Write some tests
Fix whitespace