Fix minor error messages bug