Fix some issues with modularity