Add security to avoid importing bad geometry

* Added related tests