Code changes to module system that remove contract oddities