Stack depth calculation correction.
merge fix