Fixed relation identification and SOPviewer. There are still bugs