Updated type conversion and fixed upload error