Only add docs if they are not null. Fixes test.