Patch from James H to fix the occasional generation of puzzles