Fix some bit accounting