Added support for tie detection.