Make sure runtime type is correct.