Generate correct filename and fix warning