fixed BitStream handling