fix reading of fig files