Fix expect sanity check logic