Fixed a bug with mapper and type conversion