fix bug reported by Nuno Lopes when query gets sliced

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>