Several bugs - changes for RHEL7

Yeah, I'd prefer using a preprocessor of some sort over per-OS branching.