Added extra parity check and 'N' handling to decodeHamming