Fixed self-casting issue.