fix subdir permissions. Fixes #609