Bug fix for the Backdoor Factory generation to ensure
valid caves are chosen.