Fixed a bug where modules weren't correctly initialized