reworked std::string hack

This hack is seriously not nice, but needed for backward compatibility.