Bug found: must change bit calculation