Fix HAL-138: Call stack size exceeded