Fixing undefined offset notice if fields are empty.