Detect "head of the input" correctly