Use Compatibility.string instead of basestring