When not using C++0X, stream.clear() should be called to reuse stream.
Merge remote-tracking branch 'remotes/origin/master'