Cleans up can_write_to_container()