Fix block checking code