Added FAILSAFE feature, including docs and tests.