Optimize code and tread warnings as errors
Only use one startup thread

This fixes the crash at startup