Add exceptions
Add more tests
Improve exceptions handling