Various fixes for modules