Bugfix for synclegacydb script