Tinkered with name references to make them more reliable when given in different case etc