Fix wrong file access modes during test