Fix multiple legends bug