minor bugfixes in cookie handling