Add error messages and remove the type argument