Backport Bugfix: Stack Overflow (3-0-stable) #5044

Merged
merged 2 commits into from Apr 30, 2012