Fixed bug, that potentially read bits beyond the buffer space.