Fix new issue due to SQLAlchemy 0.9.6 upgrade