Merge "Handle wrong file format when printing." into lmp-dev