Improved heading detection.