When encountering already seen stack item we should fail only if it is a collection. Duplicate Integers or ByteArrays are ok because they can't lead to recursion.