Added some silly type casting to get rid of some silly errors.