Improved string detection.