Guard against empty Q-Expr in 'head'
Fix '!='.