fix coding style
tweak error messages