Fixing single direction hadlock/ruben algorithms.