GetMasterInstance() now internally waits until the join process is complete.
Removed debug output.
Simplified example.