Replace cast with the correct modifer.