Use more global checks, fix consistency
Convert a missed sha1 empty check