Fix state check in candidate inner loop.
Merge pull request #65 from benbjohnson/fix-candidate-loop-state-check

Fix state check in candidate inner loop.