Get object name correctly when it has label.