Restored previous failsafe algorithms
Tests give much better numbers this way