bug fixes for new module system