Adding safeguard against dirty branches
Added safeguard against unsynced child/master