Added namespaces, and made the parser a bit more robust w/r/t error catching.