Fixed StreamEquals method.

Fixes #666