Minor: error messages added and checked.