modified some error messages and a little formatting