Fix bug in implementation of sub modules