Fixed mongoose sessions error. Closes #439.