Fix function frame identification (cc#2025)

This fixes [CureCode issue #2025](http://issue.cc/r3/2025) and [CureCode issue #2044](http://issue.cc/r3/2044).Tested in Linux (0.4.4).