Fix for #1766