Improved session usage in the base ConstructQuery class.