tools: some updates to the auto_merge script

Change-Id: I84fb1506b7dd34ebfde1d77147e1a502a1a1afc4