Fixed bug with output data size