Fixed NullPointerException during import

closes #236