Fixed bug with unwanted datatype change