Adding default branch detection and setting.