Removes unnecessary casts causes by Resharper.