Correct logic to avoid 'undefined' label style being inserted.