Cleaning the code a little more to figure out the cause of the non-manifoldness of the STL result