Fixed a module stack and error handling.