more fixes for Centos6 and MacOSX