Fix sync
Merge pull request #54 from guywithnose/master

Fix sync
Make the math more resilient.
Merge pull request #55 from nubs/master

Make the math more resilient.