Bulk indexing and cache fixes

Bulk indexing and cache fixes

(currently just putting it through for travis)