Fix for bug with eating tilda and slash characters in paths.