Fixed infinit loop bug decoding aninvalid stream.
Added new tests for invalid streams and two byte arrays.