Fixed more XML related bugs