Fix the direction processing.