Fix most type conversion warnings