Add clear() to few more places

@dorkster.

Check please the code. I guess we do not reuse stream data flags (like is_good() ) after clearing

See here http://www.cplusplus.com/reference/ios/ios/clear/