             func URLSession(session: NSURLSession!, dataTask: NSURLSessionDataTask!, didReceiveResponse response: NSURLResponse!, completionHandler: ((NSURLSessionResponseDisposition) -> Void)!) {
                 var disposition: NSURLSessionResponseDisposition = .Allow
 
-                if self.dataTaskDidReceiveResponse {
+                if self.dataTaskDidReceiveResponse != nil {
                     disposition = self.dataTaskDidReceiveResponse!(session, dataTask, response)
                 }
 


            func URLSession(session: NSURLSession!, task: NSURLSessionTask!, willPerformHTTPRedirection response: NSHTTPURLResponse!, newRequest request: NSURLRequest!, completionHandler: ((NSURLRequest!) -> Void)!) {
                var redirectRequest = request
                if self.taskWillPerformHTTPRedirection {
                    redirectRequest = self.taskWillPerformHTTPRedirection!(session, task, response, request)
                }



            func URLSession(session: NSURLSession!, task: NSURLSessionTask!, needNewBodyStream completionHandler: ((NSInputStream!) -> Void)!) {
                var bodyStream: NSInputStream?
                if self.taskNeedNewBodyStream != nil {
                    bodyStream = self.taskNeedNewBodyStream!(session, task)
                }

