Fixed bugs in the new routing system and in the sidebar trait