Fixed read-only permissions in tests.

Fixes #703.