Fix bugs and add test for lz4.