Improved error handling. Catch exceptions due to XML type mismatch.