Fix Locals analysis

Nested Functions support was clumsy, this should fix #186.
Merge pull request #170 from serge-sans-paille/fix-locals

Fix Locals analysis