Improve gui detection.