Updated cookie handling, tweak some bits