Moved commands around for better readability

For the sake of readability, the 0-ing of host variables was
clustered with the corresponding reduction "for" loop.