Fix missing assignment to `err` variable