Type casting fix