Fixed exception handling inconsistency