Added functionality to the sidebar and some minor fixes.