Fixed some tests regarding the newer versions of SQLAlchemy