Improve legend tests