Fix all direction code.