Fixed problem with labels causing the legend to crash.