Simplify some reflection code.
Merge pull request #39 from kisielk/master

Simplify some reflection code.