Jython-compatibility adaptations