Added validation for importing data. Fixes #18.