Added tests for the correct reporting of assignments of undefined (see #1070)