     private var errorBeforeSetErrorCallBack: NSError?
     internal let receivedDataBuffer: NSMutableData
 	private let uniqueIdentifier: String
+    private let validNewlineCharacters = ["\r\n", "\n", "\r"]
 
     var event = Dictionary<String, String>()
 

            // Search for next occurrence of delimiter
            searchRange.location = foundRange.location + foundRange.length
            searchRange.length = receivedDataBuffer.length - searchRange.location
            foundRange = receivedDataBuffer.rangeOfData(delimiter, options: NSDataSearchOptions(), range: searchRange)
        }

        // Remove the found events from the buffer
        self.receivedDataBuffer.replaceBytesInRange(NSRange(location: 0, length: searchRange.location), withBytes: nil, length: 0)

        return events
    }

    private func parseEventStream(events: [String]) {

//MARK: Helpers

    private func extractEventsFromBuffer() -> [String] {
        var events = [String]()

        // Find first occurrence of delimiter
		var searchRange =  NSRange(location: 0, length: receivedDataBuffer.length)
        while let foundRange = searchForEventInRange(searchRange) {
            // Append event
            if foundRange.location > searchRange.location {
                let dataChunk = receivedDataBuffer.subdataWithRange(
