misc casting fixes