Fixed file renaming bug