Fixes #535, this switches a few hardcoded checks from str to basestring, this is the proper way to verify if it is a string or not