Fixed cookie bugs