Fixed bug in buffer for valid bits for #26.