Fix some of unsigned signed Comparing waring, Fix mem leak in RecordBasedManager::insertRecord