Sundry changes

Some of these are small changes extracted from @triffid's std::string -> char* conversion which are worth on their own. Each patch is small, self-contained, and hopefully pretty non-controversial.