Add new option --fix-deadlocks. Check for deadlocks in nodes. If option is not set, throw an error if a deadlock is found. If option is set, give a warning and add self-loop. Some minor cleanups in the parser.