Fixes issue #14: Switching from heatmap mode to day mode and back to heatmap results in crash