FIXUP: foreach fail on ref