Fixes problems with template tag functions