GUACAMOLE-88: Merge changes that were missing from previous failed merge.
diff --git a/src/chapters/adding-protocol.xml b/src/chapters/adding-protocol.xml
index cf19e90..cfe115d 100644
--- a/src/chapters/adding-protocol.xml
+++ b/src/chapters/adding-protocol.xml
@@ -202,6 +202,7 @@
 
 # Check for required build tools
 AC_PROG_CC
+AC_PROG_CC_C99
 AC_PROG_LIBTOOL
 
 # Check for libguac (http://guac-dev.org/)
@@ -267,10 +268,11 @@
     /* Send the display size */
     guac_protocol_send_size(socket, GUAC_DEFAULT_LAYER, 1024, 768);
 
-    /* Fill with solid color */
+    /* Prepare a curve which covers the entire layer */
     guac_protocol_send_rect(socket, GUAC_DEFAULT_LAYER,
             0, 0, 1024, 768);
 
+    /* Fill curve with solid color */
     guac_protocol_send_cfill(socket,
             GUAC_COMP_OVER, GUAC_DEFAULT_LAYER,
             0x80, 0x80, 0x80, 0xFF);
@@ -343,10 +345,10 @@
             bounce. While we could repeatedly draw and erase a ball on the remote display, a more
             efficient technique would be to leverage Guacamole's layers.</para>
         <para>The remote display has a single root layer, <varname>GUAC_DEFAULT_LAYER</varname>, but
-            there can be infinitely many other child layers, which can have themselves have child
-            layers, and so on. Each layer can be dynamically repositioned within and relative to
-            another layer. Because the compositing of these layers is handled by the remote display,
-            and is likely hardware-accelerated, this is a much better way to repeatedly reposition
+            there can be infinitely many other child layers, which can themselves have child layers,
+            and so on. Each layer can be dynamically repositioned within and relative to another
+            layer. Because the compositing of these layers is handled by the remote display, and is
+            likely hardware-accelerated, this is a much better way to repeatedly reposition
             something we expect to move a lot.</para>
         <para>Since we're finally adding the ball, and there needs to be some structure which
             maintains the state of the ball, we must create a header file,
@@ -411,10 +413,11 @@
     /* Set up ball layer */
     guac_protocol_send_size(socket, ball, 128, 128);
 
-    /* Fill with solid color */
+    /* Prepare a curve which covers the entire layer */
     guac_protocol_send_rect(socket, ball,
             0, 0, 128, 128);
 
+    /* Fill curve with solid color */
     guac_protocol_send_cfill(socket,
             GUAC_COMP_OVER, ball,
             0x00, 0x80, 0x80, 0xFF);
@@ -545,8 +548,8 @@
             data->ball_x = -data->ball_x;
             data->ball_velocity_x = -data->ball_velocity_x;
         }
-        else if (data->ball_x >= 1024-128) {
-            data->ball_x = (2*(1024-128)) - data->ball_x;
+        else if (data->ball_x >= 1024 - 128) {
+            data->ball_x = (2 * (1024 - 128)) - data->ball_x;
             data->ball_velocity_x = -data->ball_velocity_x;
         }
 
@@ -554,8 +557,8 @@
             data->ball_y = -data->ball_y;
             data->ball_velocity_y = -data->ball_velocity_y;
         }
-        else if (data->ball_y >= (768-128)) {
-            data->ball_y = (2*(768-128)) - data->ball_y;
+        else if (data->ball_y >= 768 - 128) {
+            data->ball_y = (2 * (768 - 128)) - data->ball_y;
             data->ball_velocity_y = -data->ball_velocity_y;
         }
 
@@ -573,8 +576,8 @@
 }</emphasis>
 
 ...</programlisting></informalexample>
-        <para>Just as with the join handler, this thread sends a "sync" instruction to denote the end
-            of each frame, though here this is accomplished with
+        <para>Just as with the join handler, this thread sends a "sync" instruction to denote the
+            end of each frame, though here this is accomplished with
                 <function>guac_client_end_frame()</function>. This function sends a "sync"
             containing the current timestamp, and updates the properties of the
                 <classname>guac_client</classname> with the last-sent timestamp (the value that our
@@ -582,7 +585,7 @@
             whole display with each frame - we simply update the position of the ball layer using a
                 <link xmlns:xlink="http://www.w3.org/1999/xlink" linkend="move-instruction">"move"
                 instruction</link>, and rely on the remote display to handle compositing on its
-            own.Th</para>
+            own.</para>
         <para>We now need to update <methodname>guac_client_init</methodname> to actually create
             this thread, initialize the ball state within the structure, and store the thread for
             future cleanup when the client terminates:</para>
@@ -666,11 +669,11 @@
             0xDD, 0xDD, 0xDD, 0xFF);
 </emphasis>
 
-    /* Fill with <emphasis>texture</emphasis> */
+    /* Prepare a curve which covers the entire layer */
     guac_protocol_send_rect(socket, GUAC_DEFAULT_LAYER,
             0, 0, 1024, 768);
 
-
+     /* Fill curve with <emphasis>texture</emphasis> */
     <emphasis>guac_protocol_send_lfill</emphasis>(socket,
             GUAC_COMP_OVER, GUAC_DEFAULT_LAYER,
             <emphasis>texture</emphasis>);
@@ -678,17 +681,19 @@
     /* Set up ball layer */
     guac_protocol_send_size(socket, ball, 128, 128);
 <emphasis>
-    /* Fill with solid color */
+    /* Prepare a circular curve */
     guac_protocol_send_arc(socket, data->ball,
             64, 64, 62, 0, 6.28, 0);
 
     guac_protocol_send_close(socket, data->ball);
 
+    /* Draw a 4-pixel black border */
     guac_protocol_send_cstroke(socket,
             GUAC_COMP_OVER, data->ball,
             GUAC_LINE_CAP_ROUND, GUAC_LINE_JOIN_ROUND, 4,
             0x00, 0x00, 0x00, 0xFF);
 
+    /* Fill the circle with color */
     guac_protocol_send_cfill(socket,
             GUAC_COMP_OVER, data->ball,
             0x00, 0x80, 0x80, 0x80);
diff --git a/tutorials/libguac-client-ball/configure.ac b/tutorials/libguac-client-ball/configure.ac
index df49a1a..4516041 100644
--- a/tutorials/libguac-client-ball/configure.ac
+++ b/tutorials/libguac-client-ball/configure.ac
@@ -8,6 +8,7 @@
 
 # Check for required build tools
 AC_PROG_CC
+AC_PROG_CC_C99
 AC_PROG_LIBTOOL
 
 # Check for libguac (http://guac-dev.org/)
diff --git a/tutorials/libguac-client-ball/src/ball.c b/tutorials/libguac-client-ball/src/ball.c
index 2dcc966..a166aaa 100644
--- a/tutorials/libguac-client-ball/src/ball.c
+++ b/tutorials/libguac-client-ball/src/ball.c
@@ -49,8 +49,8 @@
             data->ball_x = -data->ball_x;
             data->ball_velocity_x = -data->ball_velocity_x;
         }
-        else if (data->ball_x >= 1024-128) {
-            data->ball_x = (2*(1024-128)) - data->ball_x;
+        else if (data->ball_x >= 1024 - 128) {
+            data->ball_x = (2 * (1024 - 128)) - data->ball_x;
             data->ball_velocity_x = -data->ball_velocity_x;
         }
 
@@ -58,8 +58,8 @@
             data->ball_y = -data->ball_y;
             data->ball_velocity_y = -data->ball_velocity_y;
         }
-        else if (data->ball_y >= (768-128)) {
-            data->ball_y = (2*(768-128)) - data->ball_y;
+        else if (data->ball_y >= 768 - 128) {
+            data->ball_y = (2 * (768 - 128)) - data->ball_y;
             data->ball_velocity_y = -data->ball_velocity_y;
         }
 
@@ -109,10 +109,11 @@
     guac_protocol_send_cfill(socket, GUAC_COMP_OVER, texture,
             0xDD, 0xDD, 0xDD, 0xFF);
 
-    /* Fill with texture */
+    /* Prepare a curve which covers the entire layer */
     guac_protocol_send_rect(socket, GUAC_DEFAULT_LAYER,
             0, 0, 1024, 768);
 
+    /* Fill curve with texture */
     guac_protocol_send_lfill(socket,
             GUAC_COMP_OVER, GUAC_DEFAULT_LAYER,
             texture);
@@ -120,17 +121,19 @@
     /* Set up ball layer */
     guac_protocol_send_size(socket, ball, 128, 128);
 
-    /* Fill with solid color */
+    /* Prepare a circular curve */
     guac_protocol_send_arc(socket, data->ball,
             64, 64, 62, 0, 6.28, 0);
 
     guac_protocol_send_close(socket, data->ball);
 
+    /* Draw a 4-pixel black border */
     guac_protocol_send_cstroke(socket,
             GUAC_COMP_OVER, data->ball,
             GUAC_LINE_CAP_ROUND, GUAC_LINE_JOIN_ROUND, 4,
             0x00, 0x00, 0x00, 0xFF);
 
+    /* Fill the circle with color */
     guac_protocol_send_cfill(socket,
             GUAC_COMP_OVER, data->ball,
             0x00, 0x80, 0x80, 0x80);