Changed std::string::back() to *std::string::rbegin() for c++03 compatibility.