Handle local function calls

There was a problem when calling a method on "self" from within an instance. In that case the function tried to claim itself and ended up in a deadlock.
Merge pull request #19 from samuel02/per-updates

Handle local function calls