Now properly checking checksum and error code bit mask