Guard against failures when the pattern matches no keys.

Lua is weird: #tablename to get the length of a table!?