Fix table legend issue