Several bugs - changes for RHEL7

ifndef?