Fixed method for appending NL to empty elements. Previous one would lose list attribute.

Fixes #393