Refactor synchronization script, phase 2 [fixing]

Fix 2 errors, one of which was possibly causing constant Jira bugs
updating.

Change-Id: I6fcdcd4f8983430be1fb5422794fde5f9537b907
Merge "Refactor synchronization script, phase 2 [fixing]"