Fix for #950: fix error reporting location
Test for #950: Fix error reporting location