Fixing null cookie issue.

Signed-off-by: Ben Corlett <bencorlett@me.com>