Core: Added missing return statements.

Closes #6841
[Test] renamed testListenerCallbacks to testLocalNodeMasterListenerCallbacks

Also clean up internal variable namings and fixed usage of wrong setting causing last node to not use the min_master_node settings.
[Test] one more tweak to testLocalNodeMasterListenerCallbacks