Added support for configurable maximum stack size