Fixes in xml input parsing. Error handling in model layer.