Use expand_path when opening files.