Fix initial bugs on template edit page