various fixes

too many to keep track
see diff