Fix for #977