Don't use str::back() (it's C++11 only).