Bug fixed for binary output.
Replaced old value tests by value tests for each value type.