Fix term recount during WP callbacks Closes #5133