Thank you Ray. I think I have sorted it. What baffles me is, why it worked before. I had a temp class with an instant set for the links, that doesn't even exist. I can't remember, why I created that temp class at all (values in the table are 1 or 2), the temp class asks for 0. Still scratching my head. Line 199 in the file.
Anyway, it works now. Thank you for your help.