Fix issue with NSURLSession. Closes #2