Fix funny SQLAlchemy syntax.