Minor fixes

 - Override cookie if it is undefined
- Fixed variables that were not defined
- Default values