Better file import performance and error handling (#144)