Make sure _ensure_dirs gets run - fixes #80