fix bugs in sw_extend