Changed the renderElement() implementation into a slightly less dumb ver...

...sion...