Fixed some sync issues in the generator, closes #76