Fixed several bugs in the navigation