diff --git a/ethpub/pub.go b/ethpub/pub.go
index 20ba79d0b107053b495dec9eff6bb5032b580e1b..b475453af0473a78df45d3af0da0a988c1fe3b6c 100644
--- a/ethpub/pub.go
+++ b/ethpub/pub.go
@@ -170,11 +170,6 @@ func (lib *PEthereum) createTx(key, recipient, valueStr, gasStr, gasPriceStr, sc
 
 		tx = ethchain.NewContractCreationTx(value, gas, gasPrice, script)
 	} else {
-		// Just in case it was submitted as a 0x prefixed string
-		if len(scriptStr) > 0 && scriptStr[0:2] == "0x" {
-			scriptStr = scriptStr[2:len(scriptStr)]
-		}
-
 		data := ethutil.StringToByteFunc(scriptStr, func(s string) (ret []byte) {
 			slice := strings.Split(s, "\n")
 			for _, dataItem := range slice {
diff --git a/ethutil/bytes.go b/ethutil/bytes.go
index bd0df68ecde9119f07e439261b6bd609348e5ffc..5e3ee4a6f63eab340edd41f9fcf62e07e59d3619 100644
--- a/ethutil/bytes.go
+++ b/ethutil/bytes.go
@@ -5,6 +5,7 @@ import (
 	"encoding/binary"
 	"fmt"
 	"math/big"
+	"strings"
 )
 
 // Number to bytes
@@ -91,7 +92,7 @@ func IsHex(str string) bool {
 }
 
 func StringToByteFunc(str string, cb func(str string) []byte) (ret []byte) {
-	if len(str) > 1 && str[0:2] == "0x" {
+	if len(str) > 1 && str[0:2] == "0x" && !strings.Contains(str, "\n") {
 		ret = FromHex(str[2:])
 	} else {
 		ret = cb(str)