Fixed sync bug

Conflicts:

	cometbuf.c
Updated tests