More monkey patching

This PR adds more monkeypatching for some of the old APIs.