Fix for #797