Fix syntax error
Fix bugs
Add gzip support