Fixed replacing of empty 'fields' array