Duplicate imports should be reported as errors

Fixes #648