Minor code style changes for consistency
Fixed potential crash vulnerability in case malicious user provides invalid cookie string
v0.9.39