Fixed writing of too much data.