Reverted original changes. Not being familiar with Python syntax yet, I mistook the commented if blocks as compiler directives. Re-added base class.