fix various pointer signedness issues