Fixed search starting in wrong direction.

If the search started, the current search direction wasn't set but the
resulting direction was calculated upon this value. This leads the search to
start search with the last match found on the page.