Fixed a bug for listTemplates with TemplateFilter=shared.
Fix a NPE bug in listAclPolicies.