Add stack overflow checking
Add stack overflow checking
Stack and buffer size adjustments
Keep track of buffer allocation and check if buffers are full.
Buffer leak fixes