Fix filter/select function.