Only store documents when in DEBUG mode.
Fix for check on setValueKeys.