fix umpteen type errors