Fixing some bugs in navigation