Fix sanity checking after fix to #2917