Fix for #1066