Added fix for compatibility with SQLAlchemy 0.9.4.