Remove empty lines from output (fixes issue caused by Node.removeChild).