Fix type detection issue