ErrorException in EPM

Hi,

Using EPM for our Grandstream phones (mainly GXP2130), a couple of our templates have started to give errors when I try and rebuild the config files for the phones. This is a RED pop up box in the web gui:-

Both templates give the same error:-
Whoops\Exception\ErrorException
Undefined index: type
File:/drbd/httpd/www/html/admin/modules/endpoint/functions.inc/functions_grandstream.php:291

Running:-
PBX Firmware: 10.13.66-12
PBX Service Pack: 1.0.0.0
EPM: 13.0.84.3
Can you advise how to debug this?

Thanks