added debug convert and sync.
fixed an issue where ampersand was not being escaped.