Add branch merge checks in rmbranch function