*fixed: line and char location of errors was incorrect since switching to new templating mechanism

- also cleaned up some old variables