Remove duplicates & fix build