various corrections
improved error messages