Fix for python3 class-based method setting.