diff --git a/GL/draw.c b/GL/draw.c
index 38139d7..01d9cf7 100644
--- a/GL/draw.c
+++ b/GL/draw.c
@@ -3,6 +3,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <math.h>
+#include <limits.h>
 
 #include "private.h"
 #include "platform.h"
@@ -159,8 +160,8 @@ static void _readVertexData2us2f(const GLubyte* in, GLubyte* out) {
     const GLushort* input = (const GLushort*) in;
     float* output = (float*) out;
 
-    output[0] = input[0];
-    output[1] = input[1];
+    output[0] = (float)input[0] / SHRT_MAX;
+    output[1] = (float)input[1] / SHRT_MAX;
 }
 
 static void _readVertexData2ui2f(const GLubyte* in, GLubyte* out) {
diff --git a/samples/nehe06_4444twid/main.c b/samples/nehe06_4444twid/main.c
index b0649e5..3cc58d5 100644
--- a/samples/nehe06_4444twid/main.c
+++ b/samples/nehe06_4444twid/main.c
@@ -59,10 +59,10 @@ int ImageLoad(char *filename, Image *image) {
 
     fread(&header, sizeof(header), 1, file);
 
-    GLboolean twiddled = (header.type & (1 << 25)) < 1;
-    GLboolean compressed = (header.type & (1 << 29)) > 0;
-    GLboolean mipmapped = (header.type & (1 << 30)) > 0;
-    GLboolean strided = (header.type & (1 << 24)) > 0;
+    GLboolean twiddled = (header.type & (1 << 26)) < 1;
+    GLboolean compressed = (header.type & (1 << 30)) > 0;
+    GLboolean mipmapped = (header.type & (1 << 31)) > 0;
+    GLboolean strided = (header.type & (1 << 25)) > 0;
     GLuint format = (header.type >> 27) & 0b111;
 
     image->data = (char *) malloc (header.size);