Some code optimization, fixed assembly