Fix qtloops compilation for python3
Fix contour helper compilation on py3