Fix for #981