fix some bugs, and add the 'ecb' package