Use correct function name in error message.
Never take c_str() out of a temporary string object.