Fixes #248. Should fix most edge cases too.
Merge pull request #311 from surjikal/inflector-fix

Fixes #248. Should fix most edge cases too.