Updated the error msgs and minor changes.