Don't attempt to undefine methods that aren't defined

For compatibility with different versions of things