Fix session handling in map tiles generation, closes #332.