Fixed a bug to avoid generating empty lines