Improve XML syntax error handling.
Improve incomplete function and variable syntax error handling.
Improve incomplete main module error handling.