[fix] division by zero in template