Yet another fix related to #5

Previous fix did not include the case where the document had scrollbar but was not scrolled down.