Fixed bug where ~~HOME~~ was not being replaced with the right value, TODO: wean project off relative paths