Add os.path.expanduser() to more places missing it