Bugfix: avoid replacing "/home/user-alt" by "~-alt"

Add escaped backslashes so as to replace the "/home/user/" string in the path by "~/"