Fixed template generation for sqlite