Make absolute and relative template paths valid