Sync Gateway: fix typo (CBLT-216)
miscellaneous bug fixes