Perhaps make this ``basestring`` instead of ``str`` (to catch unicode values if they show up)?