fix bogus type conversion