Fixed some bugs related to type conversion