Original version of make_watertight from Brandon Smith.