I may be very wrong about this, but I believe if you change:
PHP Code:
$user['forumbits'] = implode(",\n", $modforums);
to
PHP Code:
$user['forumbits'] = implode("\n", $modforums);
in showgroups.php, you'll get rid of the comma.
About your other detail, I really wouldn't know, as that looks like incorrect editing is the culprit. Did you try using a fresh copy of the file?
Hope this helps