Fixed output directory initialization logic