Improved rectangle combining.