Updated(2013/3/31): added fix for type conversion