bugs fixed at type conversion