Improved tracing and comments in the selection logic.

Leo build: 20140829073230