Fixed error cases when multiple profiles found.