Improved logging and added management of 'unspecified' value for permissions.