Various bug fixes with bit reader