[BUGFIX] Regression: SQL error inserting tables for statictemplates