Fixes #6013, #6014, #6979 - changes for RHEL7