Fix JS errors when no cookie set