Changed the order of a couple of conditionals for a teeny-tiny speed up.