Fix NameError: 'exceptions' is not defined.