Add checkings for ANY_*_ID 3178

Addressing issue #3178. Line 165 should be a bug. Boundary restrictable is fixed as well.