Fixed exception throwing