improve error messages, and variable change marking