Sync resource and values. Add tests.