bug fixes: correct file perms on dirs