Fix two permissions bugs