Remove duplicate code of bug#348