Fix a few issues.

Fixes #5011 and #5002 .
The last word of name returned by Inflector::variable() is pluralized so it is correct.