Properly strip duplicate imports, fixes #81