Throw exceptions improvements [ci skip]
Improvements throwing exceptions, +unit-tests