streamReadBits still give EOF unexpectedly. Code needs cleaning.