Small bugfix

Fixed a bug in toggleFavorite that interfered with cookie storage.