Fix coockie function
Merge branch 'tree' into int