Fix PY2 bug: Don't use reserved name "type"