fix table name resolution for custom tables

Custom table names aren't necessarily all lower case (e.g. the package key can be ALL CAPS), so
it's safer to check for the presence of '_' instead.