When adding a top-level directory, set 'main' correctly