Makes check.sh more reliable