fixes and improvements to util.parseMsg

- use positive lookahead to parse $params divided by a single
  character correctly

- check each argument against undefined to allow replacing those
  which evaluate to false