stop using static array for gclean; fix various signedness issues