Added exceptions to be fully compatible with provided input