Fix tests for python3.
Fix stubbing of unbound methods in python 3.