Fix halting problem