Fixed code for determining of master exists when in maintenance mode for issue #12 and #9.