Fix for issue #105, also addresses cookie