Session store tests + bugfixes