Fixed template sync bug