Modifications to work with SQLAlchemy 0.6 (Debian squeeze)