Revert "Cleanup some monkey patching."

This reverts commit 5cb34cdab4da971fc76b33de4581cddb301bfbe3.