Remove debug code; fix sync