More fixes for promises and modules