Fixed some 64bit warnings by using size_t instead of unsigned.