Added some type casting