 sum_value_inputs = ($els) ->
   sum_inputs $els
     .filter(->!!@value)
-    .map(-> +parseValue @value).get()
+    .map(-> +parseValue @value.trim()).get()
 
 module.exports = tx_builder

      unspent = _unspent
      balance = sum_inputs unspent
      $('.balance').text (formatValue balance)+' BTC'
  do update_balance
  
  cb_success = cb.bind null, null

    # Read outputs from DOM
    el.find('.address').each ->
      $this = $ this
      # Ignore empty addresses
      return unless address = $this.find('[name=address]').val().trim()

      amount = +parseValue $this.find('[name=value]').val().trim()
      try out_script = create_out_script address
      catch err
        $this.find('[name=address]').focus()
        throw err
      tx.addOutput new TransactionOut
        script: out_script
        value: amount

    unless tx.outs.length
      throw new Error 'No output address provided'

    change = tx.total_in - (sum_inputs tx.outs) - get_fee()
    if change > 0
      tx.addOutput new TransactionOut
