Fixes essential synchronization bugs.