Fix error with empty arrays in input fields