fixed some integer casting warnings