Permission fix - last one I hope.

Fixed permissions and ownership attribution block order
Explicit permission modification on $data_directory and $data_directory/* (recursive + content)