Bugfix: getElement would return undefined when there was no match for key, instead of null.