Added some safety type changing