make sure string variables used in sqlalchemy statements are actually strings

[FIXED] variables of DisplayString type can cause problems unless converted to
    string.