Fix some .query/scoped_session issues on lib.saw