Fix: head -c -2 does not work on Mac OSX

Signed-off-by: Gregory Detal <gregory.detal@uclouvain.be>