Just a correction of compression setting

There was CompressionMethod instead of CompressMethod.
It took me a long time to find out why it does not work :-)
Merge pull request #24 from Froggiewalker/patch-2

Just a correction of compression setting
Move connection code to private method