Fix bugs for option ppp in template