fine tuned lookup/templating errors

this fixes the case where relative lookups for file/template stopped working, also improves error handling and reverts a few recent changes that are now not needed.