minor bugfix in cleanup_implicitgeometries() function