Casting fixes all around.