Casting bug fixed