Bound selection of folders correctly.

  Since all our selected_folder/selected_message/etc functions
 start at zero we have to compare to "foo.count() - 1 ".

  i.e. THis is wrong "bar < foo.size", and we must use "<= foo.size".