Stopped _write from clobbering cache, since this breaks multiple adds. (Also added if __name__... for easier debuggging)