Fixed NPE with icon names, and made icon registry code easier to read