Add a few sanity checks.  Rename a function to be more clear.
Merge branch 'master' of https://github.com/bryanlew/cs240f14central