Fix permissions. Fixes #1641.