Some fixes to get it compiling on 4.3 bsd