Fix api double emit on comment nodes (fixes #876)