Fixed critical issue in refactored startup code