Fixed some type errors