Bug fix for invalid XML