Fixed Debug function call. Fixed User-Agent header
Removed unused functions