Fix template storage