Use of boost::make_shared in query

Fourth pass.