Minor improvements for the native platform

This pull request addresses some minor issues with the native platform's initialization and the main loop.