Bugfixes to importing