diff --git a/ethereal/assets/qml/wallet.qml b/ethereal/assets/qml/wallet.qml
index 7fc7f5447d8f2595d639b171f2969ade3fe888e3..f6b31f0fd4307584cf62f838c0f8089685a33efa 100644
--- a/ethereal/assets/qml/wallet.qml
+++ b/ethereal/assets/qml/wallet.qml
@@ -158,20 +158,35 @@ ApplicationWindow {
 					anchors.leftMargin: 5
 					anchors.topMargin: 5
 					TextField {
-						id: txAmount
+						id: txRecipient
+						placeholderText: "Recipient address (or empty for contract)"
+						Layout.fillWidth: true
+					}
+
+					TextField {
+						id: txValue
 						width: 200
 						placeholderText: "Amount"
 					}
-
 					TextField {
-						id: txReceiver
-						placeholderText: "Receiver Address (or empty for contract)"
-						Layout.fillWidth: true
+						id: txGas
+						width: 200
+						placeholderText: "Gas"
+						anchors.left: txValue
+						anchors.leftMargin: 5
+					}
+					TextField {
+						id: txGasPrice
+						width: 200
+						placeholderText: "Gas price"
+						anchors.left: txGas
+						anchors.leftMargin: 5
 					}
 
 					Label {
 						text: "Transaction data"
 					}
+
 					TextArea {
 						id: codeView
 						anchors.topMargin: 5
@@ -180,9 +195,11 @@ ApplicationWindow {
 					}
 
 					Button {
+						id: txButton
 						text: "Send"
 						onClicked: {
-							console.log(eth.createTx(txReceiver.text, txAmount.text, codeView.text))
+							this.enabled = false
+							console.log(eth.createTx(txRecipient.text, txValue.text, txGas.text, txGasPrice.text, codeView.text))
 						}
 					}
 				}
diff --git a/ethereal/ui/library.go b/ethereal/ui/library.go
index 05fffd579a29fc07bcfd09e25d25fe65720e79fd..bd67f3c201c5273629731f3be646923a3318b47c 100644
--- a/ethereal/ui/library.go
+++ b/ethereal/ui/library.go
@@ -5,6 +5,7 @@ import (
 	"fmt"
 	"github.com/ethereum/eth-go/ethchain"
 	"github.com/ethereum/eth-go/ethutil"
+	"github.com/obscuren/mutan"
 	"strings"
 )
 
@@ -14,6 +15,50 @@ type EthLib struct {
 	txPool       *ethchain.TxPool
 }
 
+func (lib *EthLib) CreateTx(recipient, valueStr, gasStr, gasPriceStr, data string) string {
+	var hash []byte
+	var contractCreation bool
+	if len(recipient) == 0 {
+		contractCreation = true
+	} else {
+		var err error
+		hash, err = hex.DecodeString(recipient)
+		if err != nil {
+			return err.Error()
+		}
+	}
+
+	keyPair := ethutil.Config.Db.GetKeys()[0]
+	value := ethutil.Big(valueStr)
+	gas := ethutil.Big(valueStr)
+	gasPrice := ethutil.Big(gasPriceStr)
+	var tx *ethchain.Transaction
+	// Compile and assemble the given data
+	if contractCreation {
+		asm, err := mutan.NewCompiler().Compile(strings.NewReader(data))
+		if err != nil {
+			return err.Error()
+		}
+
+		code := ethutil.Assemble(asm)
+		tx = ethchain.NewContractCreationTx(value, gasPrice, code)
+	} else {
+		tx = ethchain.NewTransactionMessage(hash, value, gasPrice, gas, []string{})
+	}
+	tx.Nonce = lib.stateManager.GetAddrState(keyPair.Address()).Nonce
+	tx.Sign(keyPair.PrivateKey)
+	lib.txPool.QueueTransaction(tx)
+
+	if contractCreation {
+		ethutil.Config.Log.Infof("Contract addr %x", tx.Hash()[12:])
+	} else {
+		ethutil.Config.Log.Infof("Tx hash %x", tx.Hash())
+	}
+
+	return ethutil.Hex(tx.Hash())
+}
+
+/*
 func (lib *EthLib) CreateTx(receiver, a, data string) string {
 	var hash []byte
 	if len(receiver) == 0 {
@@ -31,7 +76,7 @@ func (lib *EthLib) CreateTx(receiver, a, data string) string {
 
 	amount := ethutil.Big(a)
 	code := ethchain.Compile(strings.Split(data, "\n"))
-	tx := ethchain.NewTransaction(hash, amount, code)
+	tx := ethchain.NewTx(hash, amount, code)
 	tx.Nonce = lib.stateManager.GetAddrState(keyPair.Address()).Nonce
 
 	tx.Sign(keyPair.PrivateKey)
@@ -46,6 +91,7 @@ func (lib *EthLib) CreateTx(receiver, a, data string) string {
 
 	return ethutil.Hex(tx.Hash())
 }
+*/
 
 func (lib *EthLib) GetBlock(hexHash string) *Block {
 	hash, err := hex.DecodeString(hexHash)
diff --git a/ethereum/dev_console.go b/ethereum/dev_console.go
index 5452b9a61510faf79cbd49a213692d137c680b3d..5fdf90509695ec68173c7211a29b9c059a25c76d 100644
--- a/ethereum/dev_console.go
+++ b/ethereum/dev_console.go
@@ -190,7 +190,11 @@ func (i *Console) ParseInput(input string) bool {
 			}
 		case "contract":
 			fmt.Println("Contract editor (Ctrl-D = done)")
-			asm := mutan.NewCompiler().Compile(strings.NewReader(i.Editor()))
+			asm, err := mutan.NewCompiler().Compile(strings.NewReader(i.Editor()))
+			if err != nil {
+				fmt.Println(err)
+				break
+			}
 
 			code := ethutil.Assemble(asm)