Put least expensive checks first
Merge pull request #527 from timtucker/patch-1

Put least expensive checks first