Indeed it is correct, though it was very tricky to debug such a silly mistake, so I thought of clarifying it.