Conditional fixed, and changed to not execute immediately.

When called, it will just run the test once to see what it will access. This version behaves well if called from within a transaction, and does not support any infinite loops like the old one.