Make session calculating from buffer work properly.