Detecting current section fix

We run into some issues when our top nav was ordered differently than the sections on the page. In our case the link to the top section was moved from the first position to the last which made it always be returned.
This change fixes the issue and makes sure that when you are at the bottom of your page, last section is being returned even if it's to small to be chosen based on regular calculations.