Fixed some exceptions (using ruby 2.1.2p95).

Since ruby 1.9 require needs ./ to find includes in the working directory.
Also, the cookie may be nil.