Fix handling of empty elements

refs #48