fix optimizing pchoice

Hi @birbbit, I could reproduce this bug, and found that it ran surprisingly deep. I think I've patched things up.