Add permissions

and small fixes