Fix for #839