Add support for swap files and rename script