issue #2790: includes <algorithm> for std::for_each.
issue #2790: Android build was ok, fixes some warnings.