Save import history only when path associated

Fixes #570