Bug fixes for cookies