Add log file and fix indices