Fix bugs caused by authorisation system rewrite