fixes to support more compilers / environments