Fix: Improve error handling to work in StrictUndefined mode.