Fix for #1777