Fixed writing empty string and