     
     // Sends a message
     func emit(event:String, args:AnyObject? = nil) {
-        if (!self.connected) {
+        if !self.connected {
             return
         }
+        
         var frame:Event!
         var str:String!
         
         if let dict = args as? NSDictionary {
             // Check for binary data
             let (newDict, hadBinary, binaryDatas) = self.parseNSDictionary(dict: dict)
-            if (hadBinary) {
+            if hadBinary {
                 frame = Event(event: event, args: newDict, placeholders: binaryDatas!.count)
                 str = frame.createBinaryMessage()
                 self.io?.send(str)
+                
                 for data in binaryDatas! {
                     let sendData = self.createBinaryDataForSend(data)
                     self.io?.send(sendData)
                 }
+                
                 return
             }
         } else if let binaryData = args as? NSData {

            Begin check for message
            **/
            let messageGroups = mutMessage["(\\d*)(\\[.*\\])?"].groups()
            if (messageGroups.count == 3 && messageGroups[1] == "42") {
                let messagePart = messageGroups[2]
                let messageInternals = RegexMutable(messagePart)["\\[\"(.*?)\",(.*?)?\\]$"].groups()
                if (messageInternals != nil && messageInternals.count > 2) {
                    let event = messageInternals[1]
                    var data:String?
                    if (messageInternals[2] == "") {
                        data = nil
                    } else {
                        data = messageInternals[2]

    
    // Handles binary data
    func parseBinaryData(data:NSData) {
        if self.lastSocketMessage == nil {
            return
        }
        
