Handled exceptions and some error cases