do not automatically assign IDs larger than number of nodes (as reported by #244)
better error message when referenced node in frequency does not exist, fixes #244