Tweaked, to make it a little less prescriptive :)
Fix permissions.
More simplistic approach.