Fix complex selector handling