Fixed navbar changes.

Code cleanup so that errors where fixed and navbar now properly works.