Renamed some exceptions
Better exception handling