Fixed type incompatibility errors