error message translation, and some bug fix