           switch (dir) {
             case 0:
               // Negative direction
-              analogWrite(motor_x[0], LOW);
               analogWrite(motor_x[1], spd);
+              digitalWrite(motor_x[1], HIGH);
               break;
-            default:
+            case 1:
               // Positive direction
               analogWrite(motor_x[0], spd);
-              analogWrite(motor_x[1], LOW);
+              digitalWrite(motor_x[1], LOW);
               break;
           }
           break;
-        default:
+        case 1:
           // Y-axis
           switch (dir) {
             case 0:
               // Negative direction
-              analogWrite(motor_y[0], LOW);
               analogWrite(motor_y[1], spd);
+              digitalWrite(motor_y[1], HIGH);
               break;
-            default:
+            case 1:
               // Positive direction
               analogWrite(motor_y[0], spd);
-              analogWrite(motor_y[1], LOW);
+              digitalWrite(motor_y[1], LOW);
               break;
           }
           break;
       }
     }
-  } else {
-    // If serial is not available, shut down to prevent damage.
-    digitalWrite(motor_x[0], LOW);
-    digitalWrite(motor_x[1], LOW);
-    digitalWrite(motor_y[0], LOW);
-    digitalWrite(motor_y[1], LOW);
   }
   // Wait 25 ms to allow settling
   //TODO: If multiple messages are sent within a span of 25 milliseconds, this could be bad.

#define SPEED_MASK 0x0f

// Motor pins
int motor_y[] = {2, 5};
int motor_x[] = {6, 9};

void setup() {
  Serial.begin(9600);

      //TODO: Should be command & SPEED_MASK?
      uint8_t spd = command & SPEED_MASK;
      //TODO: This line creates a quadratic releationship between what should be linear speed values. It would be better to multiply by a constant.
      if (spd == 16) {
        spd = 256;
      } else {
        spd = spd * 16;
      }

      // Write the motor speeds
      switch (axis) {
