Fix up module tracking and add better handling of possibly missing values