Fix boundary case of navigation, move #define to header