updating clean_geometry and simplify function calls so they are compatible with postgis 2