Changed the order of how some code should run.
Changed the order of how logging code should run.