Simplify stack depth management.
merge trunk