Fixes cast issue