Stack depth calculation correction.