Improve error messages in linexprs.py