Serveral fixes for module path processing.