Changing where the reset SQL goes.

This fixes the issue with piling SQL on top of each other, which
resulted in issues with the 404 pages.