check that v is a string, closes #15
pep8 cleanup