Fix opening files when not in top level