fix bit conversion.