Fixed issue with empty attribute keys. Fixed issue with states dialog on OSX. Fixes #33