Fixed casting issue.