Bug fixes for Query Manager.