Preserve undefined values better.
Added docs.