Fix plan debugging code