1.2.2; porting changes from PortFusion.c back to Haskell