Fixed problem handling empty elements.