a lot of fixes for rhel/centos support