Fixed select function.