Fix integer conversion