some type error fixes