Autofocus prediction and filename bug fix