improved type conversion for csv parsing