fix buffer length typo

The 'output' array was created with a capacity of 16, but you were indexing up to 20. Shouldn't this have been crashing?