Fix Trac #1470: improve handling of recursive instances (needed for SYB3)