Fix templates path building