Fixed detection of an existing module environment