Add doubling stack extend, as fix for #2016
Merge pull request #2158 from kyab/support_doubling_stack

Add doubling stack extend, as fix for #2016