Added pipe mode detection.