Improved error message on undefined variable access