Added more meaningful error messages