fixing a bug when demoting tuples in the planners