Fixes an issue with empty elements.
Fixes further issues with empty elements.