Fix 'possible loss of data' warnings