Fix index out of range if no filename given.