Fix order of priority reading / file reading (bug #3860)