Write test for errors
Change names of exceptions