Fixed broken synchronization. Well, the first 2 test programs work at least.
Fixed synchronization issues. Well, tests 1 and 2 pass at least