Fix for #1142