Added support for working with ~ in filepaths