fix for #40

From the issue: 
in the current commit the settype() function was misleadingly used in the CleanData() function. The result of settype() is not the manipulated data but a boolean result code. This results in empty inserts in many cases.