clear containers before we use them rather than after, so that in the case of exceptions we can recover. closes #127