more perm tweaking, fixes #2666