Fix integer casting