Fix for #996