Use size_t for NMEM's get_block. Change space-left check to