Fixed dynamic navigation building algorithm.