Adjusted the way in which an endpoints name is determined