fixed integer cast bug