Thanks d.willy.c.c@ for the suggestion and Melevir and Areski Belaid for work on the patch.
Thanks dave@ for the suggestion and Rohan Jain for the patch.