fix for sync_gateway/issues/292