Fixes a bug that prevented showing a legend with custom HTML