Fixed python 3 string type check.