Fix error when exporting body only of an empty buffer