Fixed some type incompatabilities