Exceptions

Improve usage of exceptions