Fixed inferring the base name.