Fix form template regression
Fix unit tests