Fixes to mysql templater.