Fixed problem in graph generation

If tags don't exist yet (or similar situations) the code shouldn't break down.