       return "STATS #{query}"
     return "STATS"
   links: (servermask, remoteserver) ->
-    if target
+    if remoteserver
       return "LINKS #{remoteserver} #{servermask}"
     if servermask
       return "LINKS #{servermask}"


  # 3.7 - Miscellaneous messages
  kill: (nickname, comment) ->
    return "KILL #{nickname} #{comment}"
  ping: (server1, server2) ->
    if server2
      return "PING #{server1} #{server2}"

  pong: (server1, server2) ->
    if server2
      return "PONG #{server1} #{server2}"
    return "PONG #{server1}"
  error: (errormessage) ->
    return "ERROR :#{errormessage}"
