error conditions validation and some code cleanup

Some conditions generated errors (ports had NN but no INSTANCE was
provided)
Some functions were called even when not needed (parsing instances when
ports had no NN, etc)