Took care of some edge cases related to swapping on uninitialized
containers.