Various bug fixes in the Query Designer