Streams: fixed basic optimization strategies + tests