Reworked the stream operator to correctly set failbits and not read more than necessary.