fix tar stream bug and add stream tests.