funny value assignments when no 'value' and doc is non-empty
I think the bug is on the fact that valid text characters such as '[]' are not allowed...