Made the navigation sorting more stable and added an active class to the current page