Proposed a fix:https://commitfest.postgresql.org/patch/7303/
Thank you for sharing.
Regards,Alexandre