Use correct value for last item.
Properly use the default sorting in panel when none has been stored in the session so far.