Fixed a few silly mistakes I introduced when refactoring.