Exceptions update

Adding more specific exceptions for compilation.
Improve test unit