Fixed setKey method writing empty nodes.