Do some basic sanity checking, lest somebody decides to be funny...