fix bug in __bit allocation