Fix referer logging