Casting error fix.