fixed some size_t/int confusions