Unbreak and refactor error messages

Change-Id: I76b1c209390345961fe09f9ccd57749231893acf