Fix issues in checkerboard detection