Fixed NPE when compression type is not set, and also fixed issue when compression type = none