Added a stack dump method to help debug.