Fix for crash when importing a second time during the same session.

The cause were global variables which weren't properly initialized.
Merge pull request #3 from Banbury/master

Fix for crash when importing a second time during the same session.