Fix setting of name to pe-name if present