Replaced BOOST_FOREACH by C++11 range-based for loops
Fixed compilation warnings