Resolved header conflicts and refactored code to ensure that cmake succeeds.