Check for null modules.
Improve compatibility when running in a browser.