Fixed integer division bug when running under python3