Added fix for #6 by @DiegoPires.
Merge pull request #16 from Coneko/sync-validity

Added fix for #6 by @DiegoPires.