Fixed unhandled exception when device's sourceXml is invalid.