Fixed writing explicit EOF.