Fix compile problems and port cat_file to new API.