Fix logical ordering of code.