Tidy up theme setting logic when some settings do not exist.  Fix enablecustomlogin logic to be the default when the setting is unknown.