Merge "Fix synchronization when preparing ids." into klp-dev