Fix typemissmatch error on linq query constants.
Fix "ContinueWith" ordering of events for login and session extending.