Fix exception handling
Implement naive election by least lexical hostname