Fix tests
Add exception raising tests