extra diagnostic
remove redundant/impossible checks, fix broken checks, add more checks