Fix sign extend bug