Change the string validation to basestring to address issue #231