diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,6 @@
+
+
+4.7 (28/08/2014)
+================
+
+* Open in non-blocking mode, immediately reverting to blocking to fix OS-X problem
diff --git a/README.md b/README.md
new file mode 100644
--- /dev/null
+++ b/README.md
@@ -0,0 +1,25 @@
+Objectives
+==========
+* Cross platform: at least Linux, Windows and Mac OS.
+
+Tests
+=====
+
+Setup
+-----
+* [Arduino Leonardo](http://arduino.cc/en/Main/arduinoBoardLeonardo) + [Sparkfun FTDI breakout board](https://www.sparkfun.com/products/718).
+* Connections: TX, RX and GND
+
+Prepare Arduino
+---------------
+* Upload arduino code using Arduino IDE or avrdude
+
+Prepare haskell test program
+----------------------------
+* Configure cabal to build the tests: cabal configure --enable-tests.
+* Build: cabal build
+
+Running the tests
+-----------------
+* Run the tests: cabal test --test-options="/dev/ttyACM0 /dev/ttyUSB0"
+
diff --git a/System/Hardware/Serialport/Posix.hsc b/System/Hardware/Serialport/Posix.hsc
--- a/System/Hardware/Serialport/Posix.hsc
+++ b/System/Hardware/Serialport/Posix.hsc
@@ -73,7 +73,8 @@
            -> SerialPortSettings
            -> IO SerialPort
 openSerial dev settings = do
-  fd' <- openFd dev ReadWrite Nothing defaultFileFlags { noctty = True }
+  fd' <- openFd dev ReadWrite Nothing defaultFileFlags { noctty = True, nonBlock = True }
+  setFdOption fd' NonBlockingRead False
   let serial_port = SerialPort fd' defaultSerialSettings
   return =<< setSerialSettings serial_port settings
 
diff --git a/System/Hardware/Serialport/Types.hs b/System/Hardware/Serialport/Types.hs
--- a/System/Hardware/Serialport/Types.hs
+++ b/System/Hardware/Serialport/Types.hs
@@ -21,8 +21,8 @@
 
 
 data StopBits = One | Two deriving (Show, Eq, Bounded)
-data Parity = Even | Odd | NoParity deriving (Show, Eq, Bounded)
-data FlowControl = Software | NoFlowControl deriving (Show, Eq, Bounded)
+data Parity = Even | Odd | NoParity deriving (Show, Eq)
+data FlowControl = Software | NoFlowControl deriving (Show, Eq)
 
 data SerialPortSettings = SerialPortSettings {
                       commSpeed    :: CommSpeed,   -- ^ baudrate
diff --git a/serialport.cabal b/serialport.cabal
--- a/serialport.cabal
+++ b/serialport.cabal
@@ -1,5 +1,5 @@
 Name:           serialport
-Version:        0.4.6
+Version:        0.4.7
 Cabal-Version:  >= 1.8
 Build-Type:     Simple
 license:        BSD3
@@ -12,6 +12,9 @@
 synopsis:       Cross platform serial port library.
 description:    Cross platform haskell library for using the serial port.
 category:       Hardware
+Extra-Source-Files: README.md
+                    CHANGELOG.md
+                    tests/haskell_serial_test/haskell_serial_test.ino
 
 source-repository head
   type:     git
diff --git a/tests/Tests.hs b/tests/Tests.hs
--- a/tests/Tests.hs
+++ b/tests/Tests.hs
@@ -95,8 +95,8 @@
       ("b19200 Serialport", testSerialport CS19200),
       ("b57600 Serialport", testSerialport CS57600),
       ("b115200 Serialport",testSerialport CS115200),
-      ("b9600 Handle",      testHandle CS9600),
-      ("test delay",        testDelay)
+      ("b9600 Handle",      testHandle CS9600)
+      --("test delay",        testDelay)
       ]
 
 
diff --git a/tests/haskell_serial_test/haskell_serial_test.ino b/tests/haskell_serial_test/haskell_serial_test.ino
new file mode 100644
--- /dev/null
+++ b/tests/haskell_serial_test/haskell_serial_test.ino
@@ -0,0 +1,166 @@
+static int test_running;
+static uint8_t expected_char;
+
+static const uint8_t lowest_expected_char = 0x00;
+static const uint8_t highest_expected_char = 0xff;
+
+// the setup routine runs once when you press reset:
+void setup()
+{
+  // initialize the digital pin as an output.
+  Serial.begin(9600);
+  pinMode(13, OUTPUT);
+}
+
+
+
+void ConsumeAllSerial()
+{
+  while( Serial.available() )
+    Serial.read();
+}
+
+
+
+// the loop routine runs over and over again forever:
+void loop()
+{
+  if( Serial.available() )
+  {
+    int i = Serial.read();
+    switch(i)
+    {
+      case 'a':
+        Serial.write(i);
+        Serial1.end();
+        Serial1.begin(1200);
+        ConsumeAllSerial();
+        test_running = 1;
+        expected_char = lowest_expected_char;
+        break;
+      case 'b':
+        Serial.write(i);
+        Serial1.end();
+        Serial1.begin(2400);
+        ConsumeAllSerial();
+        test_running = 1;
+        expected_char = lowest_expected_char;
+        break;
+      case 'c':
+        Serial.write(i);
+        Serial1.end();
+        Serial1.begin(4800);
+        ConsumeAllSerial();
+        test_running = 1;
+        expected_char = lowest_expected_char;
+        break;
+      case 'd':
+        Serial.write(i);
+        Serial1.end();
+        Serial1.begin(9600);
+        ConsumeAllSerial();
+        test_running = 1;
+        expected_char = lowest_expected_char;
+        break;
+      case 'e':
+        Serial.write(i);
+        Serial1.end();
+        Serial1.begin(19200);
+        ConsumeAllSerial();
+        test_running = 1;
+        expected_char = lowest_expected_char;
+        break;
+      case 'f':
+        Serial.write(i);
+        Serial1.end();
+        Serial1.begin(57600);
+        ConsumeAllSerial();
+        test_running = 1;
+        expected_char = lowest_expected_char;
+        break;
+      case 'g':
+        Serial.write(i);
+        Serial1.end();
+        Serial1.begin(115200);
+        ConsumeAllSerial();
+        test_running = 1;
+        expected_char = lowest_expected_char;
+        break;
+      case 'h':
+        Serial.write(i);
+        Serial1.end();
+        Serial1.begin(9600);
+        ConsumeAllSerial();
+        test_running = 2;
+        break;
+    }
+  }
+
+  if( test_running == 1 )
+  {
+    while( Serial1.available() )
+    {
+      uint8_t i = Serial1.read() & 0xff;
+      if( i == expected_char)
+      {
+        Serial1.write(expected_char);
+        if( expected_char == highest_expected_char )
+        {
+          // test successfull
+          Serial.println("ok");
+          Serial1.flush();
+          Serial1.end();
+          test_running = 0;
+        }
+        else
+          expected_char++;
+      }
+      else
+      {
+        Serial.print("expected char('");
+        Serial.print(expected_char, HEX);
+        Serial.print("') got ('");
+        Serial.print(i, HEX);
+        Serial.println("') test failed");
+      }
+    }
+  }
+  else if( test_running == 2 )
+  {
+    while( Serial1.available() )
+    {
+      uint8_t i = Serial1.read() & 0xff;
+      switch( i )
+      {
+        case 'a':
+          Serial1.write('a');
+          Serial1.write('A');
+          break;
+        case 'b':
+          Serial1.write('b');
+          delay(50);
+          Serial1.write('B');
+          break;
+        case 'c':
+          Serial1.write('c');
+          delay(150);
+          Serial1.write('C');
+          break;
+        case 'd':
+          Serial1.write('d');
+          delay(200);
+          Serial1.write('D');
+          break;
+        case 'e':
+          // 50 ms delay
+          delay(500);
+          Serial1.write('E');
+          break;
+        default:
+          test_running = 0;
+          break;
+      }
+    }
+  }
+}
+
