Correctly account for elements at bottom of page

Previous fix for issue #5 didn't take into account elements in firefox which are below possible scroll position