fix some bugs in the assembly