Fix bad chunk existence detection logic