Search selection and case bugs fixed