Improve perspective correction