fix level int vs float division for py3