Fix compile errors

-newlib-c++ sample crashes on startup (stack overflow)