Fixed an improper error message

Forgot to check that type=="string" before doing pattern matching on a field content.

Was triggered when version was provided as a string in a luarock.