Add security to avoid importing bad geometry
* Added related tests
* Removed non useful lines