Add checks for where argument in package use API.

Fixes #1262.