fixed bug in flatmap codegen where output buffer was not being updated properly after resize