fixed bug on tuple output, and mis-referenced field