Added and fixed tests around the sidebar. Some bug fixing around authorisation.