cookies: Fix bugs found during CI