Fix resource warnings

Fix two new instances of ResourceWarning that seem to have come in with Python 3.3.