Fix bug to create same encoder for LZW and DEFLATE
Bug fix for NullPointerException