change type of exception raised, fix docs typo