Fixed issue with type detection.