Fixes bug that showed an empty legend