a lot of ugly fixes for rhel/centos