Fixed name clash on set_cookie. Fixed exit status on error