Some minor refactoring. Fixed bug where name was not being set correctly. Fixed bug where UI metadata was not displayed correctly.