Fix error reporting in layouts and includes

This fixes the reporting of syntax errors in layouts and includes so that they are reported with the correct source text displayed.