Remove gp_sync field.

- Remove useless gp_sync field
- Bug fixes
- Small code improvements
- To be tested...