files permissions and some tweaks