Recreate args dictionary with str() arguments, use closures

Fixes #776
Merge pull request #781 from ZyX-I/segment-calls

Recreate args dictionary with str() arguments, use closures