Make sure tables are visible when checking indexes.

Also try to use parameters in the order in which they are passed.