Small code cleanup starting adding error checking to xml parser