Fix bugs in LDPC pattern