Fix DefinitionException thrown by checkDisposalMethod
Fix typos