Corrected a bug in python2 implementation involving QString and str.