diff --git a/src/Lunr/Vortex/WNS/Tests/WNSDispatcherOAuthTest.php b/src/Lunr/Vortex/WNS/Tests/WNSDispatcherOAuthTest.php
index a4b08a4f9142771f036614683010afe8c7f38b42..1f3e99f961af109620b8f7e2f6addcda6a691baa 100644
--- a/src/Lunr/Vortex/WNS/Tests/WNSDispatcherOAuthTest.php
+++ b/src/Lunr/Vortex/WNS/Tests/WNSDispatcherOAuthTest.php
@@ -42,7 +42,7 @@ class WNSDispatcherOAuthTest extends WNSDispatcherTest
      */
     public function testGetOathMakesCorrectRequest()
     {
-        $request_post = json_encode([
+        $request_post = http_build_query([
             'grant_type'    => 'client_credentials',
             'client_id'     => '012345',
             'client_secret' => '012345678',
@@ -58,19 +58,121 @@ class WNSDispatcherOAuthTest extends WNSDispatcherTest
 
         $this->curlresponse->expects($this->once())
                            ->method('get_result')
-                           ->will($this->returnValue('access_token'));
+                           ->will($this->returnValue('{"access_token":"access_token"}'));
 
         $this->class->get_oauth_token();
     }
 
     /**
+     * Test that using get_oauth_token responds with FALSE if the response is erroneous.
+     *
+     * @covers Lunr\Vortex\WNS\WNSDispatcher::get_oauth_token
+     */
+    public function testGetOathRespondsFalseIfErrorCurl()
+    {
+        $request_post = http_build_query([
+            'grant_type'    => 'client_credentials',
+            'client_id'     => '012345',
+            'client_secret' => '012345678',
+            'scope'         => 'notify.windows.com',
+        ]);
+
+        $this->expectFromConfig('012345', '012345678');
+
+        $this->curl->expects($this->once())
+                   ->method('post_request')
+                   ->with($this->equalTo('https://login.live.com/accesstoken.srf'), $this->equalTo($request_post))
+                   ->will($this->returnValue($this->curlresponse));
+
+        $this->curlresponse->expects($this->never())
+                           ->method('get_result');
+
+        $this->curlresponse->expects($this->once())
+                           ->method('__get')
+                           ->with($this->equalTo('error_number'))
+                           ->will($this->returnValue(5));
+
+        $this->logger->expects($this->once())
+                     ->method('error')
+                     ->with('Requesting token failed: No response');
+
+        $this->assertFalse($this->class->get_oauth_token());
+    }
+
+    /**
+     * Test that using get_oauth_token responds with FALSE if the response is invalid JSON.
+     *
+     * @covers Lunr\Vortex\WNS\WNSDispatcher::get_oauth_token
+     */
+    public function testGetOathRespondsFalseIfInvalidJSON()
+    {
+        $request_post = http_build_query([
+                                             'grant_type'    => 'client_credentials',
+                                             'client_id'     => '012345',
+                                             'client_secret' => '012345678',
+                                             'scope'         => 'notify.windows.com',
+                                         ]);
+
+        $this->expectFromConfig('012345', '012345678');
+
+
+        $this->curl->expects($this->once())
+                   ->method('post_request')
+                   ->with($this->equalTo('https://login.live.com/accesstoken.srf'), $this->equalTo($request_post))
+                   ->will($this->returnValue($this->curlresponse));
+
+        $this->curlresponse->expects($this->once())
+                           ->method('get_result')
+                           ->will($this->returnValue('HELLO I\'m an invalid JSON object'));
+
+        $this->logger->expects($this->once())
+                     ->method('error')
+                     ->with('Requesting token failed: Not a valid JSON response');
+
+        $this->assertFalse($this->class->get_oauth_token());
+    }
+
+    /**
+     * Test that using get_oauth_token responds with FALSE if the response is incomplete JSON.
+     *
+     * @covers Lunr\Vortex\WNS\WNSDispatcher::get_oauth_token
+     */
+    public function testGetOathRespondsFalseIfIncompleteJSON()
+    {
+        $request_post = http_build_query([
+                                             'grant_type'    => 'client_credentials',
+                                             'client_id'     => '012345',
+                                             'client_secret' => '012345678',
+                                             'scope'         => 'notify.windows.com',
+                                         ]);
+
+        $this->expectFromConfig('012345', '012345678');
+
+
+        $this->curl->expects($this->once())
+                   ->method('post_request')
+                   ->with($this->equalTo('https://login.live.com/accesstoken.srf'), $this->equalTo($request_post))
+                   ->will($this->returnValue($this->curlresponse));
+
+        $this->curlresponse->expects($this->once())
+                           ->method('get_result')
+                           ->will($this->returnValue('{"Message": "HELLO I\'m an invalid JSON object"}'));
+
+        $this->logger->expects($this->once())
+                     ->method('error')
+                     ->with('Requesting token failed: Not a valid JSON response');
+
+        $this->assertFalse($this->class->get_oauth_token());
+    }
+
+    /**
      * Test that using get_oauth_token response.
      *
      * @covers Lunr\Vortex\WNS\WNSDispatcher::get_oauth_token
      */
     public function testGetOathRespondsCorrectly()
     {
-        $request_post = json_encode([
+        $request_post = http_build_query([
             'grant_type'    => 'client_credentials',
             'client_id'     => '012345',
             'client_secret' => '012345678',
@@ -87,7 +189,7 @@ class WNSDispatcherOAuthTest extends WNSDispatcherTest
 
         $this->curlresponse->expects($this->once())
                            ->method('get_result')
-                           ->will($this->returnValue('access_token'));
+                           ->will($this->returnValue('{"access_token":"access_token"}'));
 
         $this->assertSame('access_token', $this->class->get_oauth_token());
     }
diff --git a/src/Lunr/Vortex/WNS/Tests/WNSDispatcherPushTest.php b/src/Lunr/Vortex/WNS/Tests/WNSDispatcherPushTest.php
index e567c5ef2fc2afc0c1930fe12e0ea43a90416ef4..7649d6246c5ffba87e11969c8fe8f38ecff05175 100644
--- a/src/Lunr/Vortex/WNS/Tests/WNSDispatcherPushTest.php
+++ b/src/Lunr/Vortex/WNS/Tests/WNSDispatcherPushTest.php
@@ -43,7 +43,7 @@ class WNSDispatcherPushTest extends WNSDispatcherTest
                        [
                            'X-WNS-Type: wns/tile',
                            'Accept: application/*',
-                           'Authenication: Bearer 123456',
+                           'Authorization: Bearer 123456',
                            'X-WNS-RequestForStatus: true',
                        ]));
                        $this->curl->expects($this->never())
@@ -87,7 +87,7 @@ class WNSDispatcherPushTest extends WNSDispatcherTest
                        [
                            'X-WNS-Type: wns/tile',
                            'Accept: application/*',
-                           'Authenication: Bearer 123456',
+                           'Authorization: Bearer 123456',
                            'X-WNS-RequestForStatus: true',
                        ]));
                        $this->curl->expects($this->once())
@@ -124,7 +124,7 @@ class WNSDispatcherPushTest extends WNSDispatcherTest
                        [
                            'X-WNS-Type: wns/toast',
                            'Accept: application/*',
-                           'Authenication: Bearer 123456',
+                           'Authorization: Bearer 123456',
                            'X-WNS-RequestForStatus: true',
                        ]));
                        $this->curl->expects($this->once())
@@ -191,7 +191,7 @@ class WNSDispatcherPushTest extends WNSDispatcherTest
                        [
                            'X-WNS-Type: wns/raw',
                            'Accept: application/*',
-                           'Authenication: Bearer 123456',
+                           'Authorization: Bearer 123456',
                            'X-WNS-RequestForStatus: true',
                        ]));
 
diff --git a/src/Lunr/Vortex/WNS/WNSDispatcher.php b/src/Lunr/Vortex/WNS/WNSDispatcher.php
index b772cb4a52b264f44bd6accaa261e03443b12c2c..779f525e49327728097eb81bd7527ecf20eac4fe 100644
--- a/src/Lunr/Vortex/WNS/WNSDispatcher.php
+++ b/src/Lunr/Vortex/WNS/WNSDispatcher.php
@@ -139,7 +139,7 @@ class WNSDispatcher implements PushNotificationDispatcherInterface
         $this->curl->set_http_headers([
             'X-WNS-Type: wns/' . $this->type,
             'Accept: application/*',
-            'Authenication: Bearer ' . $this->oauth_token,
+            'Authorization: Bearer ' . $this->oauth_token,
             'X-WNS-RequestForStatus: true',
         ]);
 
@@ -235,7 +235,7 @@ class WNSDispatcher implements PushNotificationDispatcherInterface
     /**
      * Get an oath token from the microsoft webservice.
      *
-     * @return mixed the Curl response.
+     * @return string|boolean the Curl response or FALSE if it failed.
      */
     public function get_oauth_token()
     {
@@ -246,9 +246,24 @@ class WNSDispatcher implements PushNotificationDispatcherInterface
             'scope'         => self::NOTIFICATION_SCOPE,
         ];
 
-        $response = $this->curl->post_request(self::TOKEN_URL, json_encode($request_post));
+        $this->curl->set_http_header('Content-Type: application/x-www-form-urlencoded');
 
-        return $response->get_result();
+        $http_response = $this->curl->post_request(self::TOKEN_URL, http_build_query($request_post));
+
+        if($http_response->error_number > 0)
+        {
+            $this->logger->error('Requesting token failed: No response');
+            return FALSE;
+        }
+
+        $response_object = json_decode($http_response->get_result());
+        if(!(json_last_error() === JSON_ERROR_NONE && property_exists($response_object, "access_token")))
+        {
+            $this->logger->error('Requesting token failed: Not a valid JSON response');
+            return FALSE;
+        }
+
+        return $response_object->access_token;
     }
 
     /**
diff --git a/src/Lunr/Vortex/WNS/WNSToastPayload.php b/src/Lunr/Vortex/WNS/WNSToastPayload.php
index 8a08f15d7b014ffac5dac2cd2861da99f9fd2d70..b60278512402030cc9eae605d111659af5ae17b3 100644
--- a/src/Lunr/Vortex/WNS/WNSToastPayload.php
+++ b/src/Lunr/Vortex/WNS/WNSToastPayload.php
@@ -54,27 +54,37 @@ class WNSToastPayload extends WNSPayload
      */
     public function get_payload()
     {
-        $xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
-        if (isset($this->elements['deeplink']))
+        $text_id = 1;
+
+        $template = 'ToastText01';
+        if(isset($this->elements['title']) && isset($this->elements['message']))
         {
-            $xml .= '<toast launch="' . $this->elements['deeplink'] . "\">\n";
+            $template = 'ToastText02';
         }
-        else
+
+        $deeplink = '';
+        if(isset($this->elements['deeplink']))
         {
-            $xml .= "<toast>\n";
+            $deeplink = $this->elements['deeplink'];
         }
 
+        $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+        $xml .= "<toast launch=\"".$deeplink."\">\n";
+
+
         $xml .= "<visual>\n";
-        $xml .= "<binding template=\"ToastGeneric\">\n";
+        $xml .= "<binding template=\"".$template."\">\n";
+
 
         if (isset($this->elements['title']))
         {
-            $xml .= '<text id="1">' . $this->elements['title'] . "</text>\n";
+            $xml .= '<text id="'.$text_id.'">' . $this->elements['title'] . "</text>\n";
+            $text_id++;
         }
 
         if (isset($this->elements['message']))
         {
-            $xml .= '<text id="2">' . $this->elements['message'] . "</text>\n";
+            $xml .= '<text id="'.$text_id.'">' . $this->elements['message'] . "</text>\n";
         }
 
         $xml .= "</binding>\n";
diff --git a/tests/statics/Vortex/wns_toast.xml b/tests/statics/Vortex/wns_toast.xml
index 796c71246c34ca2e7a019b8d2ed30a3d83959d74..fc06d101214f71112af5293389d7a0050d942154 100644
--- a/tests/statics/Vortex/wns_toast.xml
+++ b/tests/statics/Vortex/wns_toast.xml
@@ -1,9 +1,9 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <toast launch="Deeplink">
 <visual>
-<binding template="ToastGeneric">
+<binding template="ToastText02">
 <text id="1">Title</text>
 <text id="2">Message</text>
 </binding>
 </visual>
-</toast>
\ No newline at end of file
+</toast>
diff --git a/tests/statics/Vortex/wns_toast_deeplink.xml b/tests/statics/Vortex/wns_toast_deeplink.xml
index caecac7ba83da6cadad5c34e6b043f3c36ecd32f..f548c9caf8a5fc8b3e411110682266ca51ae6094 100644
--- a/tests/statics/Vortex/wns_toast_deeplink.xml
+++ b/tests/statics/Vortex/wns_toast_deeplink.xml
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <toast launch="Deeplink">
 <visual>
-<binding template="ToastGeneric">
+<binding template="ToastText01">
 </binding>
 </visual>
-</toast>
\ No newline at end of file
+</toast>
diff --git a/tests/statics/Vortex/wns_toast_message.xml b/tests/statics/Vortex/wns_toast_message.xml
index 346cc9faef0273ca1fad14898e394306fa17a722..100618ea862289c4adafcee273fd97c076edc3c7 100644
--- a/tests/statics/Vortex/wns_toast_message.xml
+++ b/tests/statics/Vortex/wns_toast_message.xml
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="utf-8"?>
-<toast>
+<?xml version="1.0" encoding="UTF-8"?>
+<toast launch="">
 <visual>
-<binding template="ToastGeneric">
-<text id="2">Message</text>
+<binding template="ToastText01">
+<text id="1">Message</text>
 </binding>
 </visual>
-</toast>
\ No newline at end of file
+</toast>
diff --git a/tests/statics/Vortex/wns_toast_title.xml b/tests/statics/Vortex/wns_toast_title.xml
index ad64457dd7507ff2140cdfaeaa3a77cf28794a3f..90ca89adfb706e016a93c20eded4844eab68bb46 100644
--- a/tests/statics/Vortex/wns_toast_title.xml
+++ b/tests/statics/Vortex/wns_toast_title.xml
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="utf-8"?>
-<toast>
+<?xml version="1.0" encoding="UTF-8"?>
+<toast launch="">
 <visual>
-<binding template="ToastGeneric">
+<binding template="ToastText01">
 <text id="1">Title</text>
 </binding>
 </visual>
