Fixed casting warnings