Fix for #1051