Replaced instances of sprintf with std::to_string()