There is an interesting thread on Reddit on a topic we touched on here several times, the topic of Google ranking the wrong version of the URL in Google Search. It all stems back to the URLs you want Google to rank being near duplicate to the URL Google ends up ranking.