Num query checking

This probably isn't ready for merge yet as I've not found the issue I started doing this for.

Refs #713