Fixed bug in simplify anonymous method issue.
Improved type guessing logic.