Fixed bug with output size on memory