Fixes to critical path algorithm.