Removes modules not in use.