Closes #2 and closes #3 by taking into account added delayed session saving.
Closes #3, with test to reproduce
inc version