Put the current template in first place & fix bug