Catch exceptions in replace file, and add tabs and re-indent
Merge pull request #1629 from Mnkras/hotfix/fix-file-replace

Catch exceptions in replace file, and add tabs and re-indent