Fixing check in cookie jar. Closes #851