Fixed typo that prevented initial permissions to be set when creating a
new document
Added checks for remote messages (matching outcome)