As I add ', ' in the "Fill in the target separator:" field at my message template configuration screen, I still get unnecessary space before comma: ' , '

As it turned out the unnecessary space comes from these lines (multiple) in the file heartbeatactivity.inc:
$merged_string .= ' ' . $stored_variables["@". $target];

As soon as I remove space, the problem went away:
$merged_string .= '' . $stored_variables["@". $target];