Cleaning code
Adding goto if output buffer size is 0 so that it can be discarded