Fix handling of select