C2: added error messages for package/type checking